<?php

/* Adds jquery script */
add_action('wp_print_scripts', 'et_jquery_script',8);
function et_jquery_script(){
    wp_deregister_script('jquery');
    wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js', false, '1.8.3'); 
}



/* Admin scripts + ajax jquery code */
if ( ! function_exists( 'ipost_panel_admin_js' ) ){
	function ipost_panel_admin_js(){		
		wp_enqueue_script('ipost_functions_init', IPOST_THEME_JS_URL. 'functions-init.js');
		wp_enqueue_script('ipost_colorpicker',IPOST_THEME_JS_URL . 'colorpicker.js');		
		wp_enqueue_script('ipost_colorpicker_eye',IPOST_THEME_JS_URL . 'eye.js');		
		wp_enqueue_script('ipost_colorpicker_utils',IPOST_THEME_JS_URL . 'utils.js');		
		wp_enqueue_script('ipost_colorpicker_layout',IPOST_THEME_JS_URL . 'layout.js');		
		wp_enqueue_script('ipost_functions_bootstrap', IPOST_THEME_JS_URL. 'bootstrap.min.js');
		wp_enqueue_script('ipost_functions_uniform', IPOST_THEME_JS_URL. 'jquery.uniform.min.js');
                wp_enqueue_script('ipost_jquery_ui', IPOST_THEME_JS_UPLOADER_URL. 'header.js');
                wp_enqueue_script('ipost_jquery_tpml', IPOST_THEME_JS_UPLOADER_URL. 'util.js');
                wp_enqueue_script('ipost_jquery_image', IPOST_THEME_JS_UPLOADER_URL. 'button.js');
                wp_enqueue_script('ipost_jquery_canvas-blob', IPOST_THEME_JS_UPLOADER_URL. 'handler.base.js');
                wp_enqueue_script('ipost_jquery_transport', IPOST_THEME_JS_UPLOADER_URL. 'handler.form.js');
                wp_enqueue_script('ipost_jquery_fileupload', IPOST_THEME_JS_UPLOADER_URL. 'handler.xhr.js');
                wp_enqueue_script('ipost_jquery_upload-fp', IPOST_THEME_JS_UPLOADER_URL. 'uploader.basic.js');
                wp_enqueue_script('ipost_jquery_upload-ui', IPOST_THEME_JS_UPLOADER_URL. 'dnd.js');
                wp_enqueue_script('ipost_jquery_uploader', IPOST_THEME_JS_UPLOADER_URL. 'uploader.js');
                wp_enqueue_script('ipost_jquery_uploader_plugin', IPOST_THEME_JS_UPLOADER_URL. 'jquery-plugin.js');
                wp_enqueue_script('ipost_jquery_filedrop', IPOST_THEME_JS_URL  . 'jquery.ajaxupload.js');
                
	}
}
/* --------------------------------------------- */

/* Adds additional ipost css */
if ( ! function_exists( 'ipost_panel_css_admin' ) ){
	function ipost_panel_css_admin() { ?> 
		<link rel="stylesheet" href="<?php echo IPOST_THEME_CSS_URL ?>layout.css" type="text/css" />
		<link rel="stylesheet" href="<?php echo IPOST_THEME_CSS_URL ?>colorpicker.css" type="text/css" />
		<link rel="stylesheet" href="<?php echo IPOST_THEME_CSS_URL ?>ipost-admin.css" type="text/css" />
		<link rel="stylesheet" href="<?php echo IPOST_THEME_CSS_URL ?>bootstrap.css" type="text/css" />
		<link rel="stylesheet" href="<?php echo IPOST_THEME_CSS_URL ?>uniform.aristo.css" type="text/css" />
                <link rel="stylesheet" href="<?php echo IPOST_THEME_CSS_URL ?>fineuploader.css" type="text/css" />
                <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/ui-lightness/jquery-ui.css" />
		<style type="text/css">
		</style>
		<!--[if IE 7]>
		<style type="text/css">			
		</style>
		<![endif]-->  
		<!--[if IE 8]>
        	</style>
		<![endif]-->  
	<?php }
}
/* --------------------------------------------- */

function ipost_media_upload_scripts() {
	wp_enqueue_script('media-upload');
	wp_enqueue_script('thickbox');
	//wp_register_script('my-upload', IPOST_THEME_JS_URL.'custom_uploader.js', array('jquery','media-upload','thickbox'));
	//wp_enqueue_script('my-upload');
}
	 
function ipost_media_upload_styles() {
	wp_enqueue_style('thickbox');
}

?>
